/*

* ------------------------------------------------------------------------
* ------------------------------------------------------------------------
* |     Smart-Shop开源商城系统/ Java商城-首选电商平台系统 请务必保留此注释头信息
* |     开源地址: https://gitee.com/ningbo-qishan/gruul-mall
* ------------------------------------------------------------------------
* ------------------------------------------------------------------------
* |     可正常分享和学习源码,未经授权 不可商用！
* |     商业版中台购买/开源版商业授权 联系技术客服
* |     官网:  https://www.73app.cn/
* ------------------------------------------------------------------------
* ------------------------------------------------------------------------
* |     Copyright (c) 2016-2999 宁波启山智软科技有限公司
* |     版权所有 ,侵权必究！
* ------------------------------------------------------------------------

*/
package com.medusa.gruul.finance.api.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.medusa.gruul.common.data.base.BaseEntity;
import com.medusa.gruul.finance.api.enums.FlowTypeEnum;
import com.medusa.gruul.finance.api.enums.TradeTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

/**
 * <p>
 * 资金交易明细表
 * </p>
 *
 * @author alan
 * @since 2020 -02-22
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_finance_trade_detail")
@ApiModel(value = "FinanceTradeDetail对象", description = "资金交易明细表")
public class FinanceTradeDetail extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @ApiModelProperty(value = "id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 商铺ID
     */
    @ApiModelProperty(value = "商铺ID")
    @TableField("shop_id")
    private String shopId;

    /**
     * 交易编号
     */
    @ApiModelProperty(value = "交易编号")
    @TableField("trade_no")
    private String tradeNo;

    /**
     * 用户id
     */
    @ApiModelProperty(value = "用户id")
    @TableField("user_id")
    private String userId;

    /**
     * 用户帐号
     */
    @ApiModelProperty(value = "用户帐号")
    @TableField("user_name")
    private String userName;

    /**
     * 用户头像
     */
    @ApiModelProperty(value = "用户头像")
    @TableField("user_avatar_url")
    private String userAvatarUrl;

    /**
     * 交易类型
     */
    @ApiModelProperty(value = "交易类型:0->商品交易;1->退款;2->团长佣金提现;3->区域团长佣金提现;4->分销商佣金提现;5->提货点佣金提现 6->用户提现;7->用户返利")
    @TableField("type")
    private TradeTypeEnum type;

    /**
     * 金额
     */
    @ApiModelProperty(value = "金额")
    @TableField("amount")
    private BigDecimal amount;

    /**
     * 来源id
     */
    @ApiModelProperty(value = "来源id")
    @TableField("source_id")
    private Long sourceId;

    /**
     * 资金流向:0->收入;1->支出
     */
    @ApiModelProperty(value = "资金流向:0->收入;1->支出")
    @TableField("capital_flows")
    private FlowTypeEnum capitalFlows;

    /**
     * 订单流水号
     */
    @ApiModelProperty(value = "订单流水号")
    @TableField("sn")
    private String sn;

}
